// src/controller/open.ts
import { Body, Controller, Inject, Post } from '@midwayjs/core';
import { UserService } from '../service/user.service';
import { BaseController } from './base.controller';
import { LoginDTO } from '../dto/login';
import { PREFIX } from '../contanst';

@Controller(PREFIX + '/open')
export class OpenController extends BaseController {
  @Inject()
  userService: UserService;

  @Post('/login')
  async login(@Body() data: LoginDTO) {
    const res = await this.userService.login(data);
    return this.success(res);
  }
}
